{$layout "layout_popup"}

<h3>选择集群</h3>

<form class="ui form" method="get" action="/clusters/selectPopup">
    <div class="ui fields inline">
        <div class="ui field">
            <input type="text" name="keyword" v-model="keyword" placeholder="名称..." ref="focus"/>
        </div>
        <div class="ui field">
            <button type="submit" class="ui button">搜索</button>
        </div>
    </div>
</form>

<p class="comment" v-if="clusters.length == 0">没有找到相应的集群。</p>
<table class="ui table celled selectable" v-if="clusters.length > 0">
    <thead>
        <tr>
            <th>集群名称</th>
            <th>节点数</th>
            <th class="two wide">状态</th>
            <th class="two op">操作</th>
        </tr>
    </thead>
    <tr v-for="cluster in clusters">
        <td>
            <keyword :v-word="keyword">{{cluster.name}}</keyword>
        </td>
        <td>{{cluster.countNodes}}</td>
        <td><label-on :v-is-on="cluster.isOn"></label-on></td>
        <td>
            <span class="disabled" v-if="cluster.isSelected">已选择</span>
            <a href="" @click.prevent="select(cluster)" v-if="!cluster.isSelected">选择</a>
        </td>
    </tr>
</table>

<div v-html="page"></div>